<?php

namespace App\Providers;

use Illuminate\Database\Connection;
use Illuminate\Support\ServiceProvider;

class RiakServiceProvider extends ServiceProvider
{



    /*
     * 是否延时加载提供器
     * */
    protected $defer = true;

    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(Connection::class,function ($app){
            return new Connection($app['config']['riak']);
        });
    }


    /*
     * 获取哦提供器提供的服务
     * */
    public function provides()
    {
        return [Connection::class];
    }
}
